package application

import (
	"ruoyi-go-echo-ddd/internal/domain/model"
	"ruoyi-go-echo-ddd/internal/domain/service"

	"github.com/labstack/echo/v4"
)

type SysRoleMenuApplication struct {
	RoleMenuService *service.SysRoleMenuService
}

func NewSysRoleMenuApplication(u *service.SysRoleMenuService) *SysRoleMenuApplication {
	return &SysRoleMenuApplication{
		RoleMenuService: u,
	}
}

func (s *SysRoleMenuApplication) DeleteByRoleId(e echo.Context, roleId int64) (int64, error) {
	return s.RoleMenuService.DeleteByRoleId(e.Request().Context(), roleId)
}

func (s *SysRoleMenuApplication) BatchInsert(e echo.Context, list []*model.SysRoleMenu) (int64, error) {
	return s.RoleMenuService.BatchInsert(e.Request().Context(), list)
}
